package com.neu.entity;

public class HourlyEmployee extends ColaEmployee {
	private double hour_sal;
	private int month_hour;
	public double getHour_sal() {
		return hour_sal;
	}
	public void setHour_sal(double hour_sal) {
		this.hour_sal = hour_sal;
	}
	public int getMonth_hour() {
		return month_hour;
	}
	public void setMonth_hour(int month_hour) {
		this.month_hour = month_hour;
	}
	public HourlyEmployee() {
		super();
	}
	public HourlyEmployee(double hour_sal, int month_hour,String name,int month) {
		super(name,month);
		this.hour_sal = hour_sal;
		this.month_hour = month_hour;
	}
	@Override
	public double getSalary(int month) {
		double all_sal=0;
		if(month_hour>160) {
			all_sal=hour_sal*160+(month_hour-160)*hour_sal*1.5;
		}else {
			all_sal=hour_sal*month_hour;
		}
		if(super.getMonth()==month) {
			all_sal+=100;
		}
			
		return all_sal;
	}
}
